package en.edu.scau.cmi.zhanzhiyong.carpter05;

public class Circle {
	
	double radius, area;
	double x, y;
	
	Circle(){}
	Circle(double r){ 
		radius = r;
	}
	
	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
	}
	
	public double getY() {
		return y;
	}
	public void setY(double y) {
		this.y = y;
	}
	
	void setRadius(double r) {
		if(r > 0) {
			radius = r;
		}
		else {
			radius = 0;
		}
	}
	
	double getRadius() {
		return radius;
	}
	
	double getArea() {
		area = 3.14 * radius *radius;
		return area;
	}
}
